// @algorithm @lc id=100278 lang=cpp
// @title xuan-zhuan-shu-zu-de-zui-xiao-shu-zi-lcof

#include "algm/algm.h"
#include <iostream>
#include <string>
#include <vector>
using namespace std;
class Solution {
public:
    int minArray(vector<int> &numbers) {
        int n = numbers.size();
        int l = 0, r = n - 1;
        while (l <= r) {
            int mid = l + (r - l) / 2;
            if (numbers[mid] < numbers[r]) {
                r = mid;
            }
            else if (numbers[mid] > numbers[r]) {
                l = mid + 1;
            }
            else {
                --r;
            }
        }
        return numbers[l];
    }
};